﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string eventSourceName = "NSLService";
            string message = "test message!";

            if (!EventLog.SourceExists(eventSourceName))
            {
                EventLog.CreateEventSource(eventSourceName, "Application");
            }            
            EventLog.WriteEntry(eventSourceName, message, EventLogEntryType.Error);

            Console.Read();
        }
    }
}
